{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "45194e2e-8f46-4ca5-a88c-ab08183d4ccd",
   "metadata": {},
   "source": [
    "https://leetcode.com/problems/partition-list\n",
    "\n",
    "\n",
    "Runtime: 0 ms, faster than 100.00% of Go online submissions for Partition List.\n",
    "Memory Usage: 2.7 MB, less than 7.55% of Go online submissions for Partition List.\n",
    "\n",
    "\n",
    "```go\n",
    "func partition(head *ListNode, x int) *ListNode {\n",
    "    //7:56\n",
    "    node := head\n",
    "\tl := make([]int, 0)\n",
    "\tfor node != nil {\n",
    "\t\tl = append(l, node.Val)\n",
    "\t\tnode = node.Next\n",
    "\t}\n",
    "    a := make([]int, 0)\n",
    "    b := make([]int, 0)\n",
    "    for _, v := range l {\n",
    "        if v < x  {\n",
    "            a = append(a, v)\n",
    "        } else {\n",
    "            b = append(b, v)\n",
    "        }\n",
    "    }\n",
    "    c := append(a, b...)\n",
    "    node = head\n",
    "    i := 0\n",
    "    for node != nil {\n",
    "        node.Val = c[i]\n",
    "        i += 1\n",
    "        node = node.Next\n",
    "    }\n",
    "    return head\n",
    "    //8:06\n",
    "}\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b2f10a3e-8ca8-4fe1-83ea-ce0e3e49ad2d",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Go",
   "language": "go",
   "name": "gophernotes"
  },
  "language_info": {
   "codemirror_mode": "",
   "file_extension": ".go",
   "mimetype": "",
   "name": "go",
   "nbconvert_exporter": "",
   "pygments_lexer": "",
   "version": "go1.14.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
